<?php

include_once("../../helpers/CHtml.php");
include_once("../../helpers/CJavascript.php");
include_once("../../Misc.php");

define("_REGULER"               , "Reguler");
define("_INVOICE"               , "Invoice");
define("_DP"                    , "DP");
define("_DP_CANCEL"             , "DP Cancel");

$GHtml = new CGHtml;
$GJs   = new CGJavascript;
$Misc  = new Misc;

$propTxButton = $GJs->jsOnClick("Misc.txWindow(\"".$_SERVER["HTTP_HOST"]."\",
                                               \"suppCstNameEnt\",
                                               \"suppCstCodeEnt\",
                                               \"currencyEnt\",
                                               \"rateEnt\",
                                               \"totPrepaid\",
                                               \"typeEnt\",
                                               \"txEnt\");
                                 return false;");

switch($_POST["theTx"]){

  case _REGULER:

    $theButton = $GHtml->formHidden("txButtonEnt",
                                    $_POST["theTx"]);
    break;

  case _INVOICE:

    $label = "Invoice";
    $theButton = $GHtml->formInputButton($label,
                                         "txButtonEnt",
                                         $_POST["theTx"],
                                         $propTxButton);
    break;

  case _DP:

    $label = "DP";
    $theButton = $GHtml->formInputButton($label,
                                         "txButtonEnt",
                                         $_POST["theTx"],
                                         $propTxButton);
    break;

  case _DP_CANCEL:

    $label = "DP Cancel";
    $theButton = $GHtml->formInputButton($label,
                                        "txButtonEnt",
                                        $_POST["theTx"],
                                        $propTxButton);
    break;

  default:
}

echo  $theButton;
?>